#ifndef _IRQ_HEADER_
#define _IRQ_HEADER_

#include <typedef.h>

// Interrupt
#define SRCPND		(*((volatile unsigned long *)(0x4a000000)))		// Interrupt request status
#define INTMOD      (*((volatile unsigned long *)(0x4a000004)))     // Interrupt mode control
#define INTMSK      (*((volatile unsigned long *)(0x4a000008)))     // Interrupt mask control
#define PRIORITY    (*((volatile unsigned long *)(0x4a00000c)))     // IRQ priority control
#define INTPND		(*((volatile unsigned long *)(0x4a000010)))		// Interrupt request status
#define INTOFFSET   (*((volatile unsigned long *)(0x4a000014)))     // Interruot request source offset
#define SUBSRCPND   (*((volatile unsigned long *)(0x4a000018)))     // Sub source pending
#define INTSUBMSK   (*((volatile unsigned long *)(0x4a00001c)))     // Interrupt sub mask

#define	ClearPending(bit) {	SRCPND = bit; INTPND = bit; INTPND;	}

extern u32 	irq_disable	( void );
extern u32 	irq_restore	( u32 oldCPSR );
extern u32 	irq_enable	( void );
extern void irq_active	( unsigned long irq );
extern void irq_deactive( u32 irq );
extern void irq_clear	( u32 irq );
extern void irq_request ( u32 irq, void (*irq_func ) (void ) );
extern void irq_free	( u32 irq );
extern void irq_init	( void );

#endif //_IRQ_HEADER_
